#lang racket

(odd? 3)

(even? 4)

(define (same-parity y . ys)
(define (same-parity-with-list x xs)
  (let ((parity (if (even? x)
                    even?
                    odd?)))
    (cond ((null? xs) '())
          ((parity (car xs)) (cons (car xs) (same-parity-with-list x (cdr xs))))
          (else (same-parity-with-list x (cdr xs))))))
  (cons y (same-parity-with-list y ys)))

(same-parity 1 2 3 4 5 6 7)